<template>
   <div>
      <h2 :style="{color}">我是grandSon组件</h2>
   </div>
</template>
<script lang = "ts">
import { defineComponent,inject } from 'vue'
export default defineComponent({
  name: 'GrandSon',
  setup(){
     const color = inject('color')
     return {
        color
     }
  }
})
</script>

